package src.twice;

import javax.swing.*;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

public class AddressList extends JFrame{

    private JTextField nametextField;

//    private void kinbuttonActionPerformed(java.awt.event.ActionEvent evt){
//        try{
//            if(nametextField.getText().equals("") || (emailtextField.getText().equals("")||(phonetextField.getText().equals("")))){
//                JOptionPane.showMessageDialog(this,"请输入完整内容","信息提示框",JOptionPane.WARNING_MESSAGE);
//                return;
//            }
//            if(!file.exists()){
//                file.createNewFile();
//            }
//            BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file,true)));
//            out.write("姓名："+nametextField.getText()+",");
//            out.write("邮箱："+emailtextField.getText()+",");
//            out.write("电话："+phonetextField.getText());
//            out.newLine();
//            out.close();
//        } catch (IOException e) {
//            throw new RuntimeException(e);
//        }
//    }
}
